
<template>
  <div>
    <el-transfer v-model="transfer.checkedKeys" :data="transfer.data"></el-transfer>
    <el-button type="primary" @click="handleSubmit">保存</el-button>
  </div>
</template>

<script>

  export default {
    name: 'MenuPermission',
    props: ['menu', 'transfer'],
    methods: {
      handleSubmit: function () {
        let body = {menuId: this.menu.id, permissionId: this.transfer.checkedKeys}
        let config = {pathVar: 'permission'}
//      http.post(http.menu, body, config).then(data => {
//        this.$message({
//          message: '保存成功',
//          type: 'success'
//        })
//        this.$emit('success')
//      })
        this.$api.permissionPost(body).then(res => {
          if (res.code == '000000') {
            this.$message({
              message: '保存成功',
              type: 'success'
            })
            this.$emit('success')
          }
        })
      }
    }
  }
</script>

<style>

</style>
